module psmouse (
  clk, 		// clock input
  data		// data input
  );

input clk;
input data;

wire clk;
wire data;

reg [4:0] index = 5'b10111;
reg [23:0] d;
reg [7:0] byte1;
reg [7:0] byte2;
reg [7:0] byte3;

always @ (negedge clk)
begin : count
  d[index] <= data;
  if (index > 0) begin
    index <= index - 1;
  end
  else begin
    index <= 23;
    byte1 <= d[23:16];
    byte2 <= d[15:8];
    byte3 <= d[7:0]
  end
end

endmodule

